package chixing.day09.interfacelean;



public class Mainboard  {
    private VideoCard videoCard;
    private Cpu cpu;

    public Mainboard(){}

    public Mainboard(VideoCard videoCard, Cpu cpu) {
        this.videoCard = videoCard;
        this.cpu = cpu;
    }

    public void run(){
        System.out.println("主板正在运行");
        cpu.cpuRunning();
        videoCard.videoRunning();

    }
    public void close(){
        cpu.cpuClosing();
        videoCard.videoClosing();
        System.out.println("主板停止运行");
    }

    public VideoCard getVideoCard() {
        return videoCard;
    }

    public void setVideoCard(VideoCard videoCard) {
        this.videoCard = videoCard;
    }

    public Cpu getCpu() {
        return cpu;
    }

    public void setCpu(Cpu cpu) {
        this.cpu = cpu;
    }

    @Override
    public String toString() {
        return "Mainboard{" +
                "videoCard='" + videoCard + '\'' +
                ", cpu='" + cpu + '\'' +
                '}';
    }
}
